package com.example.disk.service.impl;

import com.example.disk.domain.entity.Download;
import com.example.disk.mapper.DownloadMapper;
import com.example.disk.obs.OBSAgent;
import com.example.disk.service.DownloadService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.InputStream;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author auto
 * @since 2020-07-15
 */
@Service
public class DownloadServiceImpl extends ServiceImpl<DownloadMapper, Download> implements DownloadService {
    @Autowired
    OBSAgent obsAgent;
    @Override
    public InputStream download(String username, String path, String filename) {
        return obsAgent.downloadFile(username, path, filename);
    }
}
